// Copyright (C) Kumo inc. and its affiliates.
// Author: Jeff.li lijippy@163.com
// All rights reserved.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published
// by the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <https://www.gnu.org/licenses/>.
//

#include <nebula/types/meta/int_types.h>

namespace nebula {

    std::string Int8Type::compute_fingerprint() const { return ::nebula::type_id_fingerprint(*this); }

    std::string Int16Type::compute_fingerprint() const { return ::nebula::type_id_fingerprint(*this); }

    std::string Int32Type::compute_fingerprint() const { return ::nebula::type_id_fingerprint(*this); }

    std::string Int64Type::compute_fingerprint() const { return ::nebula::type_id_fingerprint(*this); }

    std::string UInt8Type::compute_fingerprint() const { return ::nebula::type_id_fingerprint(*this); }

    std::string UInt16Type::compute_fingerprint() const { return ::nebula::type_id_fingerprint(*this); }

    std::string UInt32Type::compute_fingerprint() const { return ::nebula::type_id_fingerprint(*this); }

    std::string UInt64Type::compute_fingerprint() const { return ::nebula::type_id_fingerprint(*this); }


    const std::shared_ptr<DataType> &int8() {
        static std::shared_ptr<DataType> result = std::make_shared<Int8Type>();
        return result;
    }

    const std::shared_ptr<DataType> &uint8() {
        static std::shared_ptr<DataType> result = std::make_shared<UInt8Type>();
        return result;
    }

    const std::shared_ptr<DataType> &int16() {
        static std::shared_ptr<DataType> result = std::make_shared<Int16Type>();
        return result;
    }

    const std::shared_ptr<DataType> &uint16() {
        static std::shared_ptr<DataType> result = std::make_shared<UInt16Type>();
        return result;
    }

    const std::shared_ptr<DataType> &int32() {
        static std::shared_ptr<DataType> result = std::make_shared<Int32Type>();
        return result;
    }

    const std::shared_ptr<DataType> &uint32() {
        static std::shared_ptr<DataType> result = std::make_shared<UInt32Type>();
        return result;
    }

    const std::shared_ptr<DataType> &int64() {
        static std::shared_ptr<DataType> result = std::make_shared<Int64Type>();
        return result;
    }

    const std::shared_ptr<DataType> &uint64() {
        static std::shared_ptr<DataType> result = std::make_shared<UInt64Type>();
        return result;
    }

}  // namespace nebula
